#ifndef MAINWINDOW1_H
#define MAINWINDOW1_H

#include <QMainWindow>
#include <QPixmap>
#include <QDebug>
#include <QMessageBox>
#include <QPainter>
#include <QLineEdit>
#include <QObject>
#include <QTcpSocket>
#include <QJsonObject>
#include <QJsonDocument>
#include "mainwindow2.h"

namespace Ui {
class MainWindow1;
}

class MainWindow1 : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow1(QWidget *parent = 0);
    ~MainWindow1();
    void setNetworkInfo(const QString &ip, const QString &port);

private:
    Ui::MainWindow1 *ui;
    QString zhanghao;
    QString mima;
    QTcpSocket *socket;
    void sendRequest(int order, const QString &username, const QString &password);
    void processResponse(const QJsonObject &response);
    mainwindow2 *mainWindow2 = new mainwindow2();
private slots:
    void clickedSlot();
    void clickedSlot1();
    void onSocketConnected();
    void onSocketDisconnected();
    void onSocketReadyRead();
    //xiesi
    void myslot();
};

#endif // MAINWINDOW1_H
